package com.xcity.pomelo.response;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import com.xcity.game.combat.attr.CombatAttribute;
import com.xcity.game.item.ItemInfo;
import com.xcity.game.peakroad.model.response.PeakRoadBuff;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class PeakRoadFastPassResponse extends Response {
	
	public List<FloorReward> rewards;
//	public Floor current; // 跳转后的楼层信息
	public int floor;
	
	public PeakRoadFastPassResponse(int serial, List<FloorReward> rewards, int floor) {
		super(serial);
		this.rewards = rewards;
//		this.current = new Floor(player, template);
		this.floor = floor;
	}
	
	// 每层奖励信息
	public static class FloorReward {
		public int floor;
		public Collection<ItemInfo> items;
		public List<PeakRoadBuff> buffs;
		public int peakCoin;
		public FloorReward(int floor, Collection<ItemInfo> items, List<CombatAttribute> buffs, int peakCoin) {
			this.floor = floor;
			this.items = items != null ? items : Collections.emptyList();
			if (buffs != null && buffs.size() > 0) {
				this.buffs = new ArrayList<PeakRoadBuff>(buffs.size());
				for (int i = 0; i < buffs.size(); i++) {
					this.buffs.add(new PeakRoadBuff(i, buffs.get(i)));
				}
			} else {
				this.buffs = Collections.emptyList();
			}
			this.peakCoin = peakCoin;
		}
	}

}
